<?
//ignore_user_abo(); 
set_time_limit(0);
require_once("./lib/Snoopy.class.php");
require_once("./lib/func.general.php");
header( 'Content-type: text/html; charset=utf-8' );
ob_implicit_flush();
ob_end_flush();
echo "<meta charset=\"UTF-8\"><pre>";

$snoopy=new snoopy;
$snoopy->maxredirs=0;
$url="http://0.0.0.0:8080/caiji/caiji.php";
$url="http://0.0.0.0:8080/caiji/caiji.toutiao.m.xv2db.php?groupname=php&1";
$url="http://0.0.0.0:8080/caiji/caiji.toutiao.m.xv2db.php?groupname=javascript&1";
$url="http://0.0.0.0:8080/caiji/caiji.toutiao.m.xv2db.php?groupname=房产&1";
$url="http://0.0.0.0:8080/caiji/caiji.toutiao.m.xv2db.php?groupname=明星&1";


if(!empty($_GET["url_fetch"])){
 $url=$_GET["url_fetch"];
}
$i=0;
while ($i<30000){
//echo
 $str=fetchurl($url);
 $status=stripos($str,"ok");
 if($status<1){
  $status=stripos($str,"completed");
  if($status<1){
   echo bad;
  }else{
   echo over;
   break;
  }
 }
 $i++;
 echo $i;
 if($i%20==0)echo "\n";
sleep(1);
}
//echo $i;